const express = require('express')
const backData = express.Router()

backData.post('/login', function (req, res) {
  const username = req.body.username
  const password = req.body.password
  console.log(req.body)
  if (username === 'iwen' && password === '123') {
    res.send({
      code: 200,
      msg: '登陆成功',
      username: 'iwen',
      token: 'W3ER33TRHE435TERTG45edE'
    })
  } else {
    res.send({
      code: 500,
      msg: '登陆失败'
    })
  }
})

backData.get('/', function (req, res) {
  res.send('fdsnjfdjsa')
})

module.exports = backData
